<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">app</div>

  <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
  <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
  <script src="https://unpkg.com/babel-standalone@6/babel.min.js" crossorigin></script>

  <script type="text/babel">
    
    class App extends React.Component {
      constructor(props) {
        super(props)

        this.state = {
          message: 'message',
          movies: ['星球大战', '盗梦空间', '蜘蛛侠', '钢铁侠'],
          numbers: [10, 50, 60 ,20 , 70, 100, 30]
        }
      }

      render() {
        return (
          <div>
            <button onClick={() => {this.btnClick(event)}}>按钮</button>
            <ul>
              {
                this.state.movies.map((item, key) => {
                  return (
                    <li onClick={e => {this.liClick(key, item, e)}}>
                      {item}
                    </li>
                  )
                })
              }  
            </ul>
            <ul>
              {
                this.state.numbers.filter(item => item >= 50).map(item => <li>{item}</li>)
              }
            </ul>
            <ul>
              {
                this.state.numbers.slice(0, 4).map(item => <li>{item}</li>)
              }
            </ul>
          </div>
        )
      }

      btnClick(event) {
        console.log(event)
      }

      liClick(key, item, e) {
        console.log(key, ': ', item, e)
      }
    }

    ReactDOM.render(<App />, document.getElementById('app'))
  </script>
</body>
</html>